from .subscribe.version import Version
from .subscribe.robot_ready import RobotReady
from .subscribe.boot_up_state import BootUpState
from .subscribe.wifi import Wifi
from .subscribe.battery_state import BatteryState
from .subscribe.body_status import BodyStatus
from .subscribe.robot_ctrl_status import RobotCtrlStatus
from .subscribe.dog_ctrl_config import DogCtrlConfig
from .subscribe.dog_ctrl_state import DogCtrlState
from .subscribe.joint_states import JointStates
from .subscribe.imu import IMU
from .subscribe.available_actions import AvailableActions

from .advertise.set_user_mode import SetUserMode
from .advertise.set_gait import SetGait
from .advertise.set_swing_duration import SetSwingDuration
from .advertise.set_ground_model import SetGroundModel

from .action.do_action import Action

class Robot:

    def __init__(self, framework):
        self.framework = framework
        # 订阅版本信息
        self.subscribe_version = Version(self)
        # 获取机器狗是否已经入就绪状态及时间戳
        self.subscribe_robot_ready = RobotReady(self)
        # 获取启动状态
        self.subscribe_boot_up_state = BootUpState(self)
        # 获取Wifi信息
        self.subscribe_wifi = Wifi(self)
        # 获取电池状态
        self.subscribe_battery_state = BatteryState(self)
        # 获取机器狗身体状态
        self.subscribe_body_status = BodyStatus(self)
        # 获取关于机器狗运动控制的所有状态信息
        self.subscribe_robot_ctrl_status = RobotCtrlStatus(self)
        # 获取关于运动控制的用户配置信息
        self.subscribe_dog_ctrl_config = DogCtrlConfig(self)
        # 获取机器狗当前的控制状态，可用于二次开发遥控功能
        self.subscribe_dog_ctrl_state = DogCtrlState(self)
        # 获取所有关节的状态信息
        self.subscribe_joint_states = JointStates(self)
        # 获取IMU数据
        self.subscribe_imu = IMU(self)
        # 获取当前可执行的所有动作
        self.subscribe_available_actions = AvailableActions(self)

        # 设置用户模式
        self.advertise_set_user_mode = SetUserMode(self)
        # 设置移动时的步态
        self.advertise_set_gait = SetGait(self)
        # 设置移动时腿的摆动周期
        self.advertise_set_swing_duration = SetSwingDuration(self)
        # 设置地面模型
        self.advertise_set_ground_model = SetGroundModel(self)

        # 动作控制
        self.action = Action(self)
